package com.hopu.v1.pojo.classes.attendance;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * 学生考勤表
 * @TableName t_attendance
 */
@TableName(value ="t_attendance")
@Data
public class Attendance implements Serializable {
    /**
     * id
     */
    @TableId(value = "attendance_id",type = IdType.AUTO)
    private Integer attendanceId;

    /**
     * 学生id
     */
    @TableField(value = "student_id")
    private Integer studentId;

    /**
     * 班级id
     */
    @TableField(value = "class_id")
    private Integer classId;

    /**
     * 规则id
     */
    @TableField(value = "regular_id")
    private Integer regularId;

    /**
     * 考勤日期
     */
    @TableField(value = "attendance_date")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate attendanceDate;

    /**
     * 上班卡时间
     */
    @TableField(value = "start_hours")
    @JsonFormat(pattern = "HH:mm:ss" , timezone = "GMT+8")
    @DateTimeFormat(pattern = "HH:mm:ss")
    private LocalTime startHours;

    /**
     * 下班卡时间
     */
    @TableField(value = "end_hours")
    @JsonFormat(pattern = "HH:mm:ss" , timezone = "GMT+8")
    @DateTimeFormat(pattern = "HH:mm:ss")
    private LocalTime endHours;

    /**
     * 状态
     */
    @TableField(value = "attendance_status")
    private Integer attendanceStatus;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}